import groovy.json.JsonSlurper

def header=" --header PRIVATE-TOKEN:azR3q1ysQsCx6R3Evyua ";
def urlPrefix="http://git.qilu-dev.com/api/v3";

def idUrlSuffix="/projects/owned?search=${ProjectName}";

def cmd="curl " + header + urlPrefix + idUrlSuffix;

Process  progam = ['/bin/bash','-c',cmd].execute();
def ids = new JsonSlurper().parseText(progam.text).id;

def ID=ids[0]


def urlSuffix="/projects/${ID}/repository/tags";

cmd="curl " + header + urlPrefix + urlSuffix;

progam = ['/bin/bash','-c',cmd].execute();

def tags = new JsonSlurper().parseText(progam.text).name;

def restList=[]

restList.add("develop")
restList.add("master")

for (i in tags)
{
  restList.add(i)
}


return restList;
